// 公司列表接口
import {
  companiesIdPositionFilters,
  companiesIdPosition
} from '@/api/company.js'

const state = {
  // 岗位筛选条件
  positionInfoType: [],
  // 岗位信息
  positionInfo: []
}
const mutations = {
  // 设置职位筛选条件
  setPositionInfoType (state, value) {
    state.positionInfoType = value
  },
  // 设置岗位信息
  setPositionInfo (state, value) {
    state.positionInfo = value
  }
}
const actions = {
  async getPositionInfoType ({ commit }, value) {
    const res = await companiesIdPositionFilters(value)
    // console.log('res职位筛选信息: ', res)
    commit('setPositionInfoType', res.data)
  },
  // 获取岗位信息
  async getPositionInfo ({ commit }, value) {
    const res = await companiesIdPosition(value)
    // console.log('res岗位: ', res.data.list)
    commit('setPositionInfo', res.data.list)
  }
}
const getters = {}
export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters
}
